<template>
  <el-dialog
    title="代理详情"
    :visible.sync="visible"
    width="1100px"
    :before-close="
      () => {
        $emit('close');
      }
    "
  >
    <div v-if="detail">
      <div class="detail-row">
        <div class="header">用户名/ID</div>
        <div class="content">{{ detail.nickname }} / {{ detail.id }}</div>
        <div class="header">手机号</div>
        <div class="content">{{ detail.username }}</div>
        <div class="header">添加时间</div>
        <div class="content"></div>
      </div>
      <div class="detail-row">
        <div class="header">代理等级</div>
        <div class="content">
          {{ detail.agent === 1 ? "社区代理" : "区县代理" }}
        </div>
        <div class="header">代理区域</div>
        <div class="content">
          <el-cascader
            expand-trigger="hover"
            :options="cityList"
            :value="[detail.province, detail.city, detail.prefecture]"
            placeholder="未知"
            @change=""
            :props="{
              value: 'v',
              label: 'n',
              children: 'c'
            }"
            disabled
            size="mini"
            style="width:200px;"
          >
          </el-cascader>
        </div>
        <div class="header">真实姓名/身份证号</div>
        <div class="content">{{ detail.realname }} / {{ detail.identity }}</div>
      </div>
      <div class="detail-row">
        <div class="header">总收益</div>
        <div class="content"></div>
        <div class="header">注册收益</div>
        <div class="content">￥{{ detail.bonus_recommend }}</div>
        <div class="header">地区收益</div>
        <div class="content">
          ￥{{ detail.area_earnings }}
        </div>
      </div>
      <div class="detail-row">
        <div class="header">分销收益</div>
        <div class="content">￥{{ detail.bonus_sell }}</div>
        <div class="header">账户余额</div>
        <div class="content">￥{{ detail.balance }}</div>
        <div class="header">已打款</div>
        <div class="content">
          ￥
        </div>
      </div>
    </div>
  </el-dialog>
</template>

<script>
import city from "@/utils/citys.js";
export default {
  props: ["visible", "detail"],
  data() {
    return {
      cityList: city
    };
  },
  watch: {
    visible: function(val) {
      if (val) {
      } else {
      }
    }
  },
  methods: {},
  created() {}
};
</script>

<style lang="scss" scoped>
.detail-row {
  display: flex;
  .header {
    height: 60px;
    background-color: #efefef;
    width: 120px;
    line-height: 60px;
    text-align: center;
    border: 1px solid #dfdfdf;
  }
  .content {
    height: 60px;
    width: 250px;
    padding: 5px 10px;
    border: 1px solid #dfdfdf;
    display: flex;
    align-items: center;
  }
}
</style>
